<template>
  <view class="page-index">
    <view :style="{height: statusBarHeight + 'px'}"></view>
    <view class="swiper">
      <swiper
        autoplay
        circular
      >
        <swiper-item v-for="(item,index) in list" :key="index">
          <image
            class="img"
            src="/static/work/banner.png"
          />
        </swiper-item>
      </swiper>
    </view>
    <!-- 滚动 -->
    <view class="notice-wrapper">
      <u-notice-bar mode="horizontal" :list="noticeList"  type="none"></u-notice-bar>
    </view>
    <!-- img-box -->
     <view class="img-box">
      <view  v-for="(item,index) in contentList" :key="index" :class="{active: index % 2 == 0 ? true : false}" class="img-x" @click="goTap(item.key)">
        <image
          mode="widthFix"
          :src="`/static/work/index/${index + 1}.png`"
        />
      </view>

     </view>
     <view style="height: 50rpx;"></view>
  </view>
</template>


<script>
export default {
  data() {
    return {
      statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
      list: [
        {
          image: "/static/work/banner.png",
          title: "昨夜星辰昨夜风，画楼西畔桂堂东",
        },
        {
          image: "/static/work/banner.png",
          title: "昨夜星辰昨夜风，画楼西畔桂堂东",
        },
        {
          image: "/static/work/banner.png",
          title: "昨夜星辰昨夜风，画楼西畔桂堂东",
        },
      ],
      noticeList: ['恭喜！于良一人成功下单...表示祝贺','恭喜！供应商A成功下单...表示祝贺','恭喜！供应商B成功下单...表示祝贺'],
      contentList: [{
        key: 'shop',
      },{
        key: 'online',
      },{
        key: 'order',
      },{
        key: 'translate',
      },{
        key: 'release',
      },{
        key: 'businessCard',
      },{
        key: 'lifeAdvertising',
      },{
        key: 'professionIIndex',
      },{
        key: 'exposurePlatform',
      }]
    }
  },
  methods: {
    goTap(key) {
      switch(key) {
        case 'shop': // 商城
          uni.navigateTo({
            url:'/pages/zWebViewShop/zWebViewShop',
          })
        break;
        case 'online': // 线上展会
          uni.navigateTo({
            url:'/pages/zWebViewOline/zWebViewOline?url=/pages/EventManagementDetail/index',
          })
        break;
        case 'order': // 采购寻单
          uni.navigateTo({
            url: '/pages/zWebViewShop/zWebViewShop?url=/pages/caigou/index/index',
          })
        break;
        case 'translate': // 翻译官
          uni.navigateTo({
            url: '/pages/zWebView/zWebView?url=/pages/translate/theInterpreter/index',
          })
        break;
        case 'release': // 运输发布
          uni.navigateTo({
            url: '/pages/zWebView/zWebView?url=/pages/publish/start',
          })
        break;
        case 'businessCard': // 货代名片
        uni.navigateTo({
            url: '/pages/zWebView/zWebView?url=/pages/forwardingInformation/index',
          })
        break;

        // 生活广告
        case 'lifeAdvertising': // 生活广告
      
        uni.navigateTo({
            url: '/pages/tabbar/lifeAdvertising/index',
          })
        break;
        case 'professionIIndex': // 专业代办
        uni.navigateTo({
            url: '/pages/tabbar/professionalList/professionIIndex',
          })
        break;
        case 'exposurePlatform': // 曝光台
        uni.navigateTo({
            url: '/pages/tabbar/exposurePlatform/index',
          })
        break;
      }
   
    }
  },

}
</script>


<style lang="scss" scoped>
  @import './index.scss';

</style>